﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DiscreteSimulation.Util
{
    public class Interval
    {
        // default percentage value.
        private const bool defaultPercentage = false;

        private void Init(double start, double end, bool hasPercentage, double percentage)
        {
            this.Start = start;
            this.End = end;

            if (this.HasPercentage = hasPercentage)
            {
                this.Percentage = percentage;
            }

            this.HasPercentage = defaultPercentage;
        }

        public Interval(double start, double end)
        {
            this.Init(start, end, defaultPercentage, 0.0);
        }

        public Interval(double start, double end, bool hasPercentage)
        {
            this.Init(start, end, hasPercentage, 0.0);
        }

        public Interval(double start, double end, bool hasPercentage, double percentage)
        {
            this.Init(start, end, hasPercentage, percentage);
        }

        public bool HasPercentage
        {
            get;
            set;
        }

        public double Start
        {
            get;
            set;
        }

        public double End
        {
            get;
            set;
        }

        public double Percentage
        {
            get;
            set;
        }
    }
}
